package com.mvu.banana.domain.server;

import javax.persistence.EntityManager;

/**
 */
public abstract class BlockReturn<T> {
  public abstract T run(EntityManager em);

  public T run() {
    EntityManager em = EMF.get().createEntityManager();
    try {
      T result = run(em);
      return result;
    } finally {
      em.close();
    }
  }

}
